package com.room.search.service.dto;

import io.swagger.annotations.ApiModel;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;

/**
 * A DTO for the {@link com.room.search.domain.RoomUser} entity.
 */
@ApiModel(description = "投诉建议")
public class RoomUserDTO implements Serializable {

    private Long id;

    @Size(max = 50)
    private String nickName;

    @NotNull
    @Size(max = 30)
    private String account;


    @Size(max = 11)
    private String mobile;

    private String avatar;

    private String slogan;

    private Boolean activated;

    private String perms;

    /**
     * 省份
     */
    private String province;
    /**
     * 市区
     */
    private String city;
    /**
     * 区县
     */
    private String district;

    public String getProvince() {
        return province;
    }

    public RoomUserDTO setProvince(String province) {
        this.province = province;
        return this;
    }

    public String getCity() {
        return city;
    }

    public RoomUserDTO setCity(String city) {
        this.city = city;
        return this;
    }

    public String getDistrict() {
        return district;
    }

    public RoomUserDTO setDistrict(String district) {
        this.district = district;
        return this;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getAccount() {
        if (Objects.isNull(account)) {
            return null;
        }
        if (account.length() == 0) {
            return null;
        }
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getMobile() {
        if (Objects.isNull(mobile)) {
            return null;
        }
        if (mobile.equals("")) {
            return null;
        }
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getSlogan() {
        return slogan;
    }

    public void setSlogan(String slogan) {
        this.slogan = slogan;
    }

    public Boolean getActivated() {
        return activated;
    }

    public RoomUserDTO setActivated(Boolean activated) {
        this.activated = activated;
        return this;
    }

    public String getPerms() {
        return perms;
    }

    public RoomUserDTO setPerms(String perms) {
        this.perms = perms;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof RoomUserDTO)) {
            return false;
        }

        RoomUserDTO roomUserDTO = (RoomUserDTO) o;
        if (this.id == null) {
            return false;
        }
        return Objects.equals(this.id, roomUserDTO.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.id);
    }

    // prettier-ignore


    @Override
    public String toString() {
        return "RoomUserDTO{" +
            "id=" + id +
            ", nickName='" + nickName + '\'' +
            ", account='" + account + '\'' +
            ", mobile='" + mobile + '\'' +
            ", avatar='" + avatar + '\'' +
            ", slogan='" + slogan + '\'' +
            ", activated=" + activated +
            ", perms='" + perms + '\'' +
            '}';
    }
}
